package com.xinyan.contorller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class PageController {

    @GetMapping("/{path}")
    public String getPath(@PathVariable String path, Model model){
        System.out.println("url = " + path);
        if ("index".equals(path)){
            System.out.println("执行了if语句=========");
            model.addAttribute("proName","雾森");
        }
        return path;
    }

    @ResponseBody
    @GetMapping("/favicon.ico")
    public void favicon(){}
}
